{/* LAYOUT模板 */}
	<layout name="layout"/>
{/* LAYOUT模板 */}

{/* import Js,Css */}
	<js href="__PUBLIC__/Js/admin/listTable.js"/>
	<js href="__PUBLIC__/Js/admin/js.util.js"/>
	<css href="__PUBLIC__/Css/admin/common.css"/>
	<js href="__PUBLIC__/Js/admin/js.selectzone.js"/>
	
	<css href="__PUBLIC__/Css/jquery-ui.css" />
	<js href="__PUBLIC__/Js/core/jquery-ui.1.10.4.js" />
	<js href="__PUBLIC__/Js/core/plugins.js"/>
{/* import Js,Css */}

<!-- [position] -->
	<include file="Template:position"/>
<!-- [position] -->
<form action="__URL__/<if condition="$action_act eq 'delivery_ship'">delivery_ship<else/>delivery_cancel_ship</if>" method="post" name="theForm">
<div class="list-div" style="margin-bottom: 5px">
	<table width="100%" cellpadding="3" cellspacing="1">
		<tr>
			<th colspan="4">基本信息</th>
		</tr>
		<tr>
			<td><div align="right"><strong>发货单流水号：</strong></div></td>
			<td>{$delivery_order.delivery_sn}</td>
			<td><div align="right"><strong>发货时间：</strong></div></td>
			<td>{$delivery_order.formated_update_time}</td>
		</tr>
		<tr>
			<td width="18%">
				<div align="right"><strong>订单号：</strong></div>
			</td>
			<td width="34%">
			{$delivery_order.order_sn}
			<if condition="$delivery_order['extension_code'] eq 'group_buy'">
				<a href="group_buy.php?act=edit&id={$delivery_order.extension_id}">
					{:L('group_buy')}
				</a>
			<elseif condition="$delivery_order['extension_code'] eq 'exchange_goods'"/>
				<a href="exchange_goods.php?act=edit&id={$delivery_order.extension_id}">
					{:L('exchange_goods')}
				</a>
			</if>
		<td>
			<div align="right"><strong>下单时间：</strong></div>
		</td>
		<td>{$delivery_order.formated_add_time}</td>
	  </tr>
	  <tr>
		<td><div align="right"><strong>购货人：</strong></div></td>
		<td>{$delivery_order.user_name}</td>
		<td><div align="right"><strong>缺货处理：</strong></div></td>
		<td>{$delivery_order.how_oos}</td>
		</tr>
		<tr>
			<td>
				<div align="right"><strong>配送方式：</strong></div>
			</td>
			<td>
				<if condition="$exist_real_goods eq 1">
					<if condition="$delivery_order['shipping_id'] gt 0">
						{$delivery_order.shipping_name}
					<else/>
						{:L('require_field')}
					</if>
					<if condition="$delivery_order['insure_fee'] gt 0">
						（  {:L('label_insure_fee')}   {$delivery_order.formated_insure_fee}  ）
					</if>
				</if>
			</td>
			<td>
				<div align="right"><strong>配送费用：</strong></div>
			</td>
			<td>{$delivery_order.shipping_fee}</td>
		</tr>
		<tr>
			<td><div align="right"><strong>是否保价：</strong></div></td>
			<td>
				<if condition="$insure_yn eq 1">
					是
				<else/>
					否
				</if>
			</td>
			<td>
				<div align="right"><strong>保价费用：</strong></div>
			</td>
			<td>{$delivery_order.insure_fee}</td>
		</tr>
		<tr>
			<td>
				<div align="right"><strong>发货单号：</strong></div>
			</td>
			<td colspan="3">
				<if condition="$delivery_order['status'] neq 1">
					<input name="invoice_no" type="text" value="{$delivery_order.invoice_no}" 
						   <if condition="$delivery_order['status'] eq 0">readonly="readonly"</if>/>
				<else/>
					{$delivery_order.invoice_no}
				</if>
			</td>
		</tr>  
		<tr>
			<th colspan="4">收货人信息</th>
		</tr>
		<tr>
			<td>
				<div align="right"><strong>收货人：</strong></div>
			</td>
			<td>{$delivery_order.consignee}</td>
			<td>
				<div align="right"><strong>电子邮件：</strong></div>
			</td>
			<td>{$delivery_order.email}</td>
		</tr>
		<tr>
			<td>
				<div align="right"><strong>地址：</strong></div>
			</td>
			<td>[{$delivery_order.region}] {$delivery_order.address}</td>
			<td><div align="right"><strong>邮编：</strong></div></td>
			<td>{$delivery_order.zipcode}</td>
		</tr>
		<tr>
			<td>
				<div align="right"><strong>电话：</strong></div>
			</td>
			<td>{$delivery_order.tel}</td>
			<td>
				<div align="right"><strong>手机：</strong></div>
			</td>
			<td>{$delivery_order.mobile}</td>
		</tr>
		<tr>
			<td>
				<div align="right"><strong>标志性建筑：</strong></div>
			</td>
			<td>{$delivery_order.sign_building}</td>
			<td>
				<div align="right"><strong>最佳送货时间：</strong></div>
			</td>
			<td>{$delivery_order.best_time}</td>
		</tr>
		<tr>
			<td>
				<div align="right"><strong>客户给商家的留言：</strong></div>
			</td>
			<td colspan="3">{$delivery_order.postscript}</td>
		</tr>
	</table>
</div>
	<!-- [商品信息] -->
	<div class="list-div" style="margin-bottom: 5px">
		<table width="100%" cellpadding="3" cellspacing="1" border="1">
			<tr>
				<th colspan="7" scope="col">商品信息</th>
			</tr>
			<tr>
				<td scope="col"><div align="center"><strong>商品名称 [ 品牌 ]</strong></div></td>
				<td scope="col"><div align="center"><strong>货号</strong></div></td>
				<td scope="col"><div align="center"><strong>货品号</strong></div></td>
				<td scope="col"><div align="center"><strong>属性</strong></div></td>
				<td scope="col"><div align="center"><strong>发货数量</strong></div></td>
			</tr>
			<volist name="goods_list" id="goods">
			<tr>
				<td>
					<a href="__APP__/goods?id={$goods.goods_id}" target="_blank">
						{$goods.goods_name}
						<if condition="$goods['brand_name'] neq ''">
							[ {$goods.brand_name} ]
						</if>
					</a>
				</td>
				<td><div align="left">{$goods.goods_sn}</div></td>
				<td><div align="left">{$goods.product_sn}</div></td>
				<td><div align="left">{$goods.goods_attr}</div></td>
				<td><div align="left">{$goods.send_number}</div></td>
			</tr>
			</volist>
		</table>
	</div>
	<!-- [操作信息] -->
	<div class="list-div" style="margin-bottom: 5px">
		<table cellpadding="3" cellspacing="1" width="100%">
			<tr>
				<th colspan="6">发货操作信息</th>
			</tr>
			<tr>
				<td>
					<div align="right"><strong>操作者：</strong></div>
				</td>
				<td>{$delivery_order.action_user}</td>
				<td>
					<div align="right"><strong>办事处：</strong></div>
				</td>
				<td colspan="5">{$delivery_order.agency_name}</td>
			</tr>
			<if condition="$delivery_order['status'] neq 1">
			<tr>
				<td>
					<div align="right"><strong>操作备注：</strong></div>
				</td>
				<td colspan="5">
					<textarea name="action_note" cols="80" rows="3"></textarea>
				</td>
			</tr>
			<tr>
				<td>
					<div align="right"><strong>当前可执行操作：</strong></div>
				</td>
				<td colspan="6" align="left">
					<if condition="$delivery_order['status'] eq 2">
						<input name="delivery_confirmed" type="submit" value="{:L('op_ship')}"/>&nbsp;&nbsp;
					<else/>
						<input name="unship" type="submit" value="{:L('op_cancel_ship')}" />
					</if>
					<input name="order_id" type="hidden" value="{$delivery_order.order_id}">
					<input name="delivery_id" type="hidden" value="{$delivery_order.delivery_id}">
					<input name="act" type="hidden" value="{$action_act}">
				</td>
			</tr>
			</if>
			<tr>
				<th>{:L('action_user')}</th>
				<th>{:L('action_time')}</th>
				<th>{:L('order_status')}</th>
				<th>{:L('pay_status')}</th>
				<th>{:L('shipping_status')}</th>
				<th>{:L('action_note')}</th>
			</tr>
			<volist name="action_list" id="action">
			<tr>
				<td><div align="center">{$action.action_user}</div></td>
				<td><div align="center">{$action.action_time}</div></td>
				<td><div align="center">{$action.order_status}</div></td>
				<td><div align="center">{$action.pay_status}</div></td>
				<td><div align="center">{$action.shipping_status}</div></td>
				<td>{$action.action_note}</td>
			</tr>
			</volist>	
		</table>
	</div>
</form>


<script language="JavaScript">
	var oldAgencyId = {$delivery_order.agency_id};
	onload = function(){
		// 开始检查订单
		//startCheckOrder();
	}
</script>



